package com.springboot.wisdom.serviceApi.system.model.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.springboot.wisdom.common.common.constant.UserTypeEnum;
import com.springboot.wisdom.serviceApi.system.model.entity.RoleDO;
import lombok.*;

@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class RoleDTO extends RoleDO {

    @JsonProperty("roleType")   // 指定序列化名。
    private String roleTypeString;
//    @JsonIgnore   // 序列化忽略此值。

    public String getRoleTypeString() {
//        System.out.println("==================================================");
//        System.out.println("返回值 =====> "+UserTypeEnum.findEnumByValueToDesc(roleTypeString));
//        System.out.println("==================================================");
        return UserTypeEnum.findEnumByValueToDesc(roleTypeString);
    }


//    public void setRoleTypeString(String roleTypeString) {
//        System.out.println("------------------------------------------------------------------");
//        System.out.println("roleTypeString = " + roleTypeString);
//        System.out.println("this.roleTypeString = " + this.roleTypeString);
//        System.out.println("UserTypeEnum.findEnumByName(roleTypeString) = " + UserTypeEnum.findEnumByDescToDesc(roleTypeString));
//        System.out.println("------------------------------------------------------------------");
//        this.roleTypeString = UserTypeEnum.findEnumByDescToDesc(roleTypeString);
//    }
}